<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文字浮动</title>
    <style>
    div{
        width:100px;
        height: 100px;
    }
    .red{
        background: red;
        float: left;
    }
    .green{
        background: green;
        /* float: left; */
        width: 300px;
        height: 300px;
    }
    .blue{
        background: blue;
        /* float: left; */
    }
    @media screen and (min-width:1000px){
        body{
            background: yellow;
        }
        div
    }

    @media screen and (max-width:1000px) and (min-width:500px){
        body{
            background: red;
        }
    }

    @media screen and (max-width:500px){
        body{
            background: green;
        }
    }
    </style>
</head>
<body>
    <div class="red"></div>
    <div class="green">大家好</div>
    <div class="blue"></div>
</body>
</html>